/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.SyncStockState;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: SyncStockRecord <br/>
 * Function: 库存数据下发记录 <br/>
 * date: 2018-12-12 15:39:07 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="sync_stock_records")
public class SyncStockRecord extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 下发记录 
    @Column(name="sync_id")
	private Long syncId = null;

	// 下发时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="this_time")
	private Date thisTime = null;

	// 状态
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private SyncStockState state = SyncStockState.SUCCESS;


    @Tolerate
	public SyncStockRecord() {
		
	}
    @Tolerate
	public SyncStockRecord(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取下发记录
	 */
	public Long getSyncId() {
		return this.syncId;
	}

    /**
     * 设置下发记录
     */
	public SyncStockRecord setSyncId(Long syncId) {
		this.syncId = syncId;
		return this;
	}

	/**
	 * 获取下发时间
	 */
	public Date getThisTime() {
		return this.thisTime;
	}

    /**
     * 设置下发时间
     */
	public SyncStockRecord setThisTime(Date thisTime) {
		this.thisTime = thisTime;
		return this;
	}

	public SyncStockState getState() {
		return state;
	}

	public void setState(SyncStockState state) {
		this.state = state;
	}
}
